<template>
  <view class="content">
    <u-upload
      action="https://www.example.com/upload"
      :file-list="fileList"
      @before-upload="beforeUpload"
      @success="handleSuccess"
    >
      <button type="primary">点击上传文件</button>
    </u-upload>
  </view>
</template>

<script setup>
import { ref } from "vue";

let fileList = ref([]);

function beforeUpload(file) {
  // 在这里你可以添加一些在上传前的检查
  // 如果返回false，则停止上传
  uni.chooseFile;
}

function handleSuccess(response, file, fileList) {
  // 在这里处理文件上传成功后的操作
}
</script>

<style lang="scss" scoped></style>
